 <%@ taglib prefix="s" uri="/struts-tags"%> 
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

 
<html >
<head>
 	   <link href="../../../css/Public.css"type="text/css" rel="stylesheet" />
       <link href="../../../css/PublicEdit.css"type="text/css" rel="stylesheet" /> 
<title>新增用户 </title>
<script>
			function checkData()
			{	
				var userinfo_ksCuserName= window.document.getElementById("userinfo_ksCuserName").value;	
			        if(userinfo_ksCuserName!=null && userinfo_ksCuserName!="")
			        {		
			        	//限制 字符和数字、长度
			        	if(userinfo_ksCuserName.length>15)
			        	{
			        	 	alert("中文名过长，最长15位！");
			        	 	window.document.getElementById("userinfo_ksCuserName").focus();
			           		window.event.returnValue = false;
			            	return;
			        	}	  
			        }
			        else
			        {            
			            alert("请输入中文名！");
			            window.event.returnValue = false;
			            return;
			        }		
					//验证数据   新用户名称
					var uname= window.document.getElementById("userinfo_username").value;	
			        if(uname!=null && uname!="")
			        {		
			        	//限制 字符和数字、长度
			        	if(uname.length>15)
			        	{
			        	 	alert("用户名过长，最长15位！");
			           		window.event.returnValue = false;
			            	return;
			        	}	  
			        	
			         <c:forEach var="blist" items="${list_UserInfo}">				  		         
			         	if(uname=="${blist.username}")
			 			 {
			     			 alert("该用户名已经存在！");
			     			 window.event.returnValue = false;
				  			 return;
					  	}		  
        			  </c:forEach>	     		
			        }
			        else
			        {            
			            alert("请输入用户名！");
			            window.event.returnValue = false;
			            return;
			        }		
			        
		 			//验证数据   密码
					var userinfo_ksPwd= window.document.getElementById("userinfo_ksPwd").value;	
			        if(userinfo_ksPwd!=null && userinfo_ksPwd!="")
			        {		
			       	 	if(userinfo_ksPwd.length>18||userinfo_ksPwd.length<6)
			        	{
			        	  	alert("用户密码长度为6-18位！");
			        	  	window.document.getElementById("userinfo_ksPwd").focus();
			           	 	window.event.returnValue = false;
			            	return;
			        	}	       	       		
			        }
			        else
			        {            
			             alert("请输入密码！");
			             window.event.returnValue = false;
			             return;
			        }				       
        			  
        			  //商务编号不能重复			
			        var userinfo_ksUserNo=window.document.getElementById("userinfo_ksUserNo").value;			        
        			if(userinfo_ksUserNo!=null && userinfo_ksUserNo!="")
			        {		
			        	//限制 字符和数字、长度
			        	if(userinfo_ksUserNo.length>15)
			        	{
			        	 	alert("用户编号长度过长，最长15位！");
			        	 	window.document.getElementById("userinfo_ksUserNo").focus();
			           	 	window.event.returnValue = false;
			            	return;
			        	}	
			        	 <c:forEach var="blist" items="${list_UserInfo}">				         
			         	if(userinfo_ksUserNo=="${blist.ksUserNo}")
			 			 {
			     			 alert("该用户编号已经存在！");
			     			 window.event.returnValue = false;
				  			 return;
					  	}	
					  	
					  	if(userinfo_ksUserNo=="${blist.ksUserNo}")
			 			 {
			     			 alert("该用户编号已经存在！");
			     			 window.event.returnValue = false;
				  			 return;
					  	}		  
        			  </c:forEach>	  
			        }		
        			var userinfo_ksIdentify=window.document.getElementById("userinfo_ksIdentify").value;			        
        			if(userinfo_ksIdentify!=null && userinfo_ksIdentify!="")
			        {		
			        	//限制 字符和数字、长度
			        	if(userinfo_ksIdentify.length>100)
			        	{
			        	 	alert("用户备注过长，最长100！");
			        	 	window.document.getElementById("userinfo_ksIdentify").focus();
			           	 	window.event.returnValue = false;
			            	return;
			        	}	  
			        }					        		      
			}						
 </script>		
</head>
<body >
<form action="/admin/user/saveuser" method="post" >
				<div>
		                <div class="l_f_top">
		                    <div class="l_f_top_left_div"><img alt="" src="../../../images/tb.gif" width="16" height="16" /></div>
		                    <div class="l_f_top_right_div">新增用户        </div>
		                </div>
		                <div class="l_f_body"> 
		                  <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                            中文名:</div>
		                        <div class="l_f_body_div5">
				                       <input type="text"  name ="userinfo_ksCuserName" id="userinfo_ksCuserName" style="width:120px"/>  
					           </div>                      
		                    </div>	  
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                            用户名:</div>
		                        <div class="l_f_body_div5">
				                       <input type="text"  name ="userinfo_username" id="userinfo_username" style="width:120px"/>  
					           </div>                      
		                    </div>	 		                  
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                              密码:</div>
		                        <div class="l_f_body_div5" >
		               		      <input type="password"  name ="userinfo_ksPwd" id="userinfo_ksPwd" style="width:120px""/>  
							   </div>
		                    </div>
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                            用户编号:</div>
		                        <div class="l_f_body_div5">
				                       <input type="text"  name ="userinfo_ksUserNo" id="userinfo_ksUserNo" style="width:120px"/>  
					           </div>                      
		                    </div>	
		                    <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                              用户组:</div>
		                        <div class="l_f_body_div5" >
		               		     <select name="userinfo_ksUserGroup" id="userinfo_ksUserGroup" style="width: 120px">
											<option value="1">技术人员</option>											
											<option value="2">运营人员</option>	
											<option value="3">管理人员</option>
											<option value="4">系统配置人员</option>
								</select>
							   </div>
		                    </div>
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                            备注:</div>
		                        <div class="l_f_body_div5">
				                       <input type="text"  name ="userinfo_ksIdentify" id="userinfo_ksIdentify"  style="width:360px" /> 
				                     
					           </div>       
		                     <div class="l_f_body_row">
		                        <div class="l_f_body_div1">                              用户状态:</div>
		                        <div class="l_f_body_div5" >
		               		     <select name="userinfo_ksStatus" id="userinfo_ksStatus" style="width: 120px">
									<option value="0">
										关闭
									</option>								
									<option value="1" selected>
										开放
									</option>							
								</select>
							   </div>
		                    </div>
		                     <div class="center l_f_body_foot">			                     
		                       <input type="submit" id="button" name="button" class="button2_60" onclick="checkData();"  value="提交"/>		                      
		                      <input type="button" class="button2_60"  onclick="javascript:history.go(-1);" value=" 返回"/> 
		                 </div>
		                </div>
			    	</div> 
			   </div>
</form>
</body>
</html>